main(b,i)
{
	char c[103];
	for(gets(c);gets(c);puts(!b?"YES":"NO"))
	{
		b=strchr(c,'.');
		if(b)
		for(i=b-(int)c+1,b=0;c[i];b|=c[i++]!='0'?1:0);
	}
}
